package algorithm.dynamicProgramming.p70;

import java.util.Arrays;

class Solution_v2 {
    public int climbStairs(int n) {
        if (n <= 0) {
            return 0;
        }
        int[] memo = new int[n + 1];
        memo[0] = 1;
        memo[1] = 1;
        for (int i = 2; i <= n; i++) {
            memo[i] = memo[i - 2] + memo[i - 1];
        }
        return memo[n];
    }

    public static void main(String[] args) {
        System.out.println(new Solution_v2().climbStairs(1));
    }
}